{% load crowdsourcing %}
<html>
<head>
  <title>Example App Home</title>
  {% include "header_tags.html" %}
</head>
<body>

<p>This page demostrates how to embed surveys and survey reports anywhere on
your site. To see it in action, set a survey up and make it public.</p>
{% if latest_survey %}
  <div id="latest_survey_div">
    <img src="/media/img/loading.gif" alt="Loading..." />
  </div>
  <script type="text/javascript">
    loadSurvey('{{ latest_survey.slug }}', 'latest_survey_div');
  </script>
  {% if latest_survey.can_have_public_submissions %}
    <div id="latest_survey_results_div">
      <img src="/media/img/loading.gif" alt="Loading..." />
    </div>
    <script type="text/javascript">
      loadSurveyResults('{{ latest_survey.slug }}',
                        '',
                        'latest_survey_results_div');
    </script>
  {% endif %}
{% else %}
  No live surveys at this time.
{% endif %}

</body>
</html>
